using Acme.BookStore.RBAC;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;

namespace Acme.BookStore.EntityFrameworkCore;


[ConnectionStringName("Default")]
public class BookStoreDbContext :
    AbpDbContext<BookStoreDbContext>
  
{
    /* Add DbSet properties for your Aggregate Roots / Entities here. */

    #region Entities from the modules

    /* Notice: We only implemented IIdentityDbContext and ITenantManagementDbContext
     * and replaced them for this DbContext. This allows you to perform JOIN
     * queries for the entities of these modules over the repositories easily. You
     * typically don't need that for other modules. But, if you need, you can
     * implement the DbContext interface of the needed module and use ReplaceDbContext
     * attribute just like IIdentityDbContext and ITenantManagementDbContext.
     *
     * More info: Replacing a DbContext of a module ensures that the related module
     * uses this DbContext on runtime. Otherwise, it will use its own DbContext class.
     */

    //Identity
   

    #endregion

    public BookStoreDbContext(DbContextOptions<BookStoreDbContext> options)
        : base(options)
    {

    }
    /// <summary>
    /// 房间类型表
    /// </summary>
    public DbSet<RoomType> RoomTypes { get; set; }
    /// <summary>
    /// 房号表
    /// </summary>
    public DbSet<RoomNumber> RoomNumbers { get; set; }
    /// <summary>
    /// 验证码 
    /// </summary>
    public DbSet<Captcha> Captcha { get; set; }


    //RBAC

    /// <summary>
    /// 权限表
    /// </summary>
    public DbSet<Permissions> Permissionss { get; set; }
    ///// <summary>
    /////角色表
    ///// </summary>
    public DbSet<Role> Roles { get; set; }
    ///// <summary>
    ///// 角色权限表
    ///// </summary>
    public DbSet<RolePermissions> RolePermissionss { get; set; }
    /// <summary>
    /// 用户表
    /// </summary>
    public DbSet<User> Users { get; set; }
    /// <summary>
    /// 用户角色表
    /// </summary>
    public DbSet<UserRole> UserRoles { get; set; }
    /// <summary>
    /// 订单表
    /// </summary>
    public DbSet<Reservations> Reservations { get; set; }
    /// <summary>
    /// 住宿表
    /// </summary>
    public DbSet<Lodging> Lodging { get; set; }
    /// <summary>
    /// 客户表
    /// </summary>
    public DbSet<ClientInfo> ClientInfo { get; set; }
    /// <summary>
    /// 这是房价计划表的实体类
    /// </summary>
    public DbSet<RatePlans> RatePlans { get; set; }

    /// <summary>
    /// 菜品表
    /// </summary>
    public DbSet<DishesInfo> DishesInfo { get; set; }
    /// <summary>
    /// 菜品分组表
    /// </summary>
    public DbSet<DishesGrouping> DishesGrouping { get; set; }
    /// <summary>
    /// 商品分类表
    /// </summary>
    public DbSet<GoodsTypeInfor> GoodsTypeInfor {  get; set; }
    /// <summary>
    /// 商品信息表
    /// </summary>
    public DbSet<GoodsInfor> GoodsInfor { get; set; }

    /// <summary>
    /// 分类管理表
    /// </summary>
    public DbSet<ClassifyManage> ClassifyManages { get; set; }
    /// <summary>
    /// 聚合商品表
    /// </summary>
    public DbSet<PolymerizationGoods> PolymerizationGoods { get; set; }
    /// <summary>
    /// 商品设置表
    /// </summary>
    public DbSet<ProductSettings> ProductSettings { get; set; }

    /// <summary>
    /// 商品标签表
    /// </summary>
    public DbSet<ProductLabels> ProductLabels { get; set; }

    /// <summary>
    /// 店铺管理表
    /// </summary>
    public DbSet<StoreManagement> StoreManagement { get; set; }


    public DbSet<Addresses> Addresses { get; set; }
    /// <summary>
    /// 购物车表
    /// </summary>
    public DbSet<ShoppingCart> ShoppingCart {  get; set; }

    /// <summary>
    /// 基本信息表
    /// </summary>
    public DbSet<BasicInformation> BasicInformations { get; set; }
    /// <summary>
    /// 预留信息表
    /// </summary>
    public DbSet<ReserveInformation> ReserveInformations { get; set; }
    /// <summary>
    /// 客户用户表
    /// </summary>
    public DbSet<UserClients> UserClients {  get; set; }
    /// <summary>
    ///商户表
    /// </summary>
    public DbSet<MerchantManagement> MerchantManagements { get; set; }
    
    protected override void OnModelCreating(ModelBuilder builder)
    {
        base.OnModelCreating(builder);

        /* Include modules to your migration db context */

        builder.ConfigureSettingManagement();
        builder.ConfigureBackgroundJobs();
        builder.ConfigureAuditLogging();
     

        /* Configure your own tables/entities inside here */

        //builder.Entity<YourEntity>(b =>
        //{
        //    b.ToTable(BookStoreConsts.DbTablePrefix + "YourEntities", BookStoreConsts.DbSchema);
        //    b.ConfigureByConvention(); //auto configure for the base class props
        //    //...
        //});
    }
}
